package com.heima.common.dtos;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * 分页返回对象
 * @param <T>
 */
@Data
@ApiModel(value="分页结果", description="前端获取分页结果")
public class PageResult<T> extends ResponseResult{

    @ApiModelProperty(value = "当前页码")
    private Long currentPage;
    @ApiModelProperty(value = "每页显示条数")
    private Long size;
    @ApiModelProperty(value = "总条数")
    private Long total;
    @ApiModelProperty(value = "业务结果")
    private List<T> data;

    public PageResult(Long currentPage, Long size, Long total, List<T> data)
    {
        this.currentPage = currentPage;
        this.size = size;
        this.total = total;
        this.data = data;
    }

}
